Setting up SwingMusic using Docker in 2025
Setting up SwingMusic using Docker in 2025

In the evolving landscape of software deployment and containerization, Docker has emerged as a cornerstone technology for simplifying application setup and management. By encapsulating software and its dependencies into lightweight, portable containers, Docker enables developers and end-users alike to achieve consistent environments across diverse systems. This approach is particularly advantageous for open-source media applications such as SwingMusic, a modern self-hosted music streaming platform designed for both functionality and ease of use.

This article provides a detailed guide to installing SwingMusic using Docker, demonstrating how containerization streamlines the process of deploying a robust and scalable personal music server. Through this method, users can avoid dependency conflicts, ensure reproducible builds, and maintain a clean host system. The following sections outline each step—from pulling the Docker image to configuring persistent storage—providing both practical instructions and conceptual insights into Docker-based deployment.

For this deployment we will be using Docker Compose. Docker Compose is a tool designed to simplify the definition and orchestration of multi-container Docker applications. Rather than managing individual containers through a series of manual commands, Docker Compose utilizes a single declarative configuration file—typically named docker-compose.yml—to specify services, networks, and volumes. This approach enables users to describe complex application architectures in a structured and reproducible manner. By executing a single command, all defined services can be built, configured, and launched simultaneously, significantly reducing setup time and human error.

The advantages of using Docker Compose are multifaceted. It enhances automation by centralizing configuration, promotes consistency across development and production environments, and supports scalability through seamless service replication. Furthermore, it simplifies maintenance and collaboration, allowing teams to share standardized configurations that can be easily version-controlled. In the context of deploying SwingMusic, Docker Compose provides a reliable mechanism to manage the application alongside its dependencies—such as databases, storage volumes, or reverse proxies—ensuring a cohesive and efficient deployment workflow.

For this deployment I am going to be using a Proxmox LXC container but this wright up will also work with a VM on Ubuntu 24.04

The first that that needs to be done is to update the OS

apt update && apt upgrade -y

apt update

&&

apt upgrade -y

Install curl

        cURL (short for Client URL) is a command-line tool used to transfer data to or from a server. It supports a wide range of protocols, including HTTP, HTTPS, FTP, and more, making it very versatile for downloading files, testing APIs, or sending data over the web. In practice, cURL is often used to quickly fetch web pages, download installation scripts, or check connectivity between a server and a URL.

apt install curl -y

Make User for setup (this is for LXC)

adduser [username]

adduser [username] sudo

su [username]


Install Docker using script

curl -sSL https://get.docker.com | sh

Add user group docker to your user account

        When you install Docker, it creates a special user group called docker. By default, only the root user can run Docker commands, which means you’d have to type sudo         every time. Adding your user to the docker group lets you run Docker as a normal user without sudo, making it more convenient for everyday use. Keep in mind,         though, that this group has root-level access to the system, so you should only add trusted users.

adduser [username] docker

Now you need to log out and log back in for the group changes to take effect.

After that, log back in with your normal user account.

To remove the root user (if you would like)

passwd -l root

Setting up SwingMusic

Create a dedicated user for SwingMusic

        It’s a good idea to run services under their own user account. Let’s make one called Navidrome:

adduser swingmusic

Get user id and group ID

        We’ll need these IDs later for Docker permissions. Run:

id swingmusic

Create a working directory

Choose a location (such as your home folder) where you want swingmusic’s files to live.

mkdir swingmusic

cd swingmusic

Create the Docker Compose file

nano docker-compose.yml

Add the default configuration

Paste the following starter configuration into the file. This will work as-is, but we’ll improve it in the next step:

version: '3'
services:
  swingmusic:
    image: ghcr.io/swingmx/swingmusic:latest
    container_name: swingmusic
    ports:
      - "1970:1970"
    volumes:
      - /home/swingmusic/music/data:/config
      - /home/swingmusic/music/music:/music
    user: "1001:1001"
    restart: unless-stopped
version: '3'
services:
  swingmusic:
    image: ghcr.io/swingmx/swingmusic:latest
    container_name: swingmusic
    ports:
      - "1970:1970"
    volumes:
      - /home/swingmusic/music/data:/config
      - /home/swingmusic/music/music:/music
    user: "1001:1001"
    restart: unless-stopped

You need to make a file to save swingmusic data in

mkdir /home/swingmusic/music/

mkdir /home/swingmusic/music/data

mkdir /home/swingmusic/music/music

Now that you have the file made you need to set promotions to swingmusic can wright to it

sudo chown -R 1001:1001 /home/swingmusic/music/

        chown

        -R

        1001:1001

        /home/swingmusic/music/

With this file made we can reopen the docker-compose.yml file and change so lines.

nano docker-compose.yml

At this point you can start swingmusic if you would like

docker compose up -d

If you do go to your Browser and enter a url of http://{serverip}:1970